package com.jeasonzhao.report.vml.base;


public class Rect extends BaseElement
{
//    private DashStyles m_attr_dashstyle = null;
    public Rect()
    {
        super();
    }

    public Rect(Vector2D topleft,Vector2D size)
    {
        super();
        setTopLeft(topleft);
        setSize(size);
    }

    public Rect(Vector2D topleft,int width,int height)
    {
        super();
        setTopLeft(topleft);
        setSize(width,height);
    }

    public Rect(int top,int left,int width,int height)
    {
        super();
        setTopLeft(top,left);
        setSize(width,height);
    }

//    public DashStyles getDashstyle()
//    {
//        return m_attr_dashstyle;
//    }

    public void setForeDepth(int n)
    {
        Extrusion ext = (Extrusion)this.getSubVmlElement(Extrusion.class);
        boolean bNew = ext == null;
        if(bNew)
        {
            ext = new Extrusion();
        }
        ext.setForedepth(n);
        if(bNew)
        {
            this.addSubVmlElement(ext);
        }
    }

    public void setBackDepth(int n)
    {
        Extrusion ext = (Extrusion)this.getSubVmlElement(Extrusion.class);
        boolean bNew = ext == null;
        if(bNew)
        {
            ext = new Extrusion();
        }
        ext.setBackdepth(n);
        if(bNew)
        {
            this.addSubVmlElement(ext);
        }
    }

    public void setShadow(boolean b)
    {
        Shadow ext = (Shadow)this.getSubVmlElement(Shadow.class);
        boolean bNew = ext == null;
        if(bNew)
        {
            ext = new Shadow();
        }
        ext.setOn(true);
        if(bNew)
        {
            this.addSubVmlElement(ext);
        }
    }

//    public void setDashstyle(DashStyles dashstyle)
//    {
//        this.m_attr_dashstyle = dashstyle;
//    }

    public static void main(String argv[])
        throws Exception
    {
        int nW = 100 * 10 / 100;
        int nH = 20;
        Rect rect = new Rect(0,0,nW,nH);
        System.out.println(rect.getScript());
    }
}
